package 慕课网.animal;

//public class Cat extends Animal{
//    private double weight;
//    public Cat(){
//
//    }
//
//    public double getWeight() {
//        return weight;
//    }
//
//    public void setWeight(double weight) {
//        this.weight = weight;
//    }
//    public void run(){
//        System.out.println(this.getName()+"是一只"+this.getSpecies()+"，它在快乐地奔跑");
//    }
//}
 class Car {
    String color;
    String motor;
    public Car(String color,String motor){
        this.color=color;
        this.motor=motor;
    }
    public Car(){

    }
}
 class Truck extends Car{
    double weight;
    public Truck(){

    }
    public Truck(String color,String motor,double weight)
    {
        super(color, motor);
        this.weight=weight;
    }
    public void display(){
        System.out.println(color+motor+weight);
    }

    public static void main(String[] args) {
        Truck truck=new Truck("红色","晕车",1.5);
        truck.display();
    }
}